package org.atovio.coolexam.service;

import org.atovio.coolexam.common.Role;
import org.atovio.coolexam.entity.User;

import java.util.List;
import java.util.Map;

public interface UserService {

    /**
     * 根据条件查询记录条数
     *
     * @param criteria 条件
     * @return 记录条数
     */
    int getCount(Map<String, Object> criteria);

    List<User> getByRole(Role role);

    List<User> getByRoleLikeUserName(Role role, String userName);

    User getByUserId(int userId);

    User addUser(User user);

    User modifyUser(User user);

    User login(User user, Role role);

    User register(User user, Role role);

    User resetPassword(User user);

    User modifyImagePath(User user);

    User modifyUserName(User user);

    User modifyPassword(User user, String oldPassword);

    void deleteByUserId(int userId);
}
